This application makes reference to, incorporates the same herein, and claims all benefits accruing under 35 U.S.C. Section 119 from an application METHOD OF DRIVING TIMER IN AN ADVANCED INTELLIGENT NETWORK SWITCHING SYSTEM EMPLOYING THE THREAD CALL STRUCTURE UNDER UNIX SYSTEM earlier filed in the Korean Industrial Property Office on the Dec. 26, 1998 and there duly assigned Serial No. 59069/1998.
1. Field of the Invention
The present invention relates to a method of driving a timer when processing a call in an advanced intelligent network (AIN) switching system employing the thread call structure services according to the UNIX system.
2. Description of the Related Art
A conventional switching system is driven by an individual operating system (OS) to process a call processing application. However, the AIN switching system recommended by ITU-T Q.1200 Series is driven by a commercial operating system known as UNIX system to process a call by performing call processing according to the service switching module (SSM), service control module (SCM), and intelligent peripheral (EP). The AIN system is more advantageous in reducing time for developing an application service and cost, as well as in enhancing reliability. When the AIN switching system processes calls, the process for each call requires a different timer at various stages from the beginning to the ending of the call process. For example, when a call is requested, there is a waiting period for the switching system to pause for the first digit of the phone number that is being dialed, and another waiting period for exchanging signals between the systems. For the conventional AIN switching system which provides a separate timer for each task of performing the call processing, the timer allocated to each processing timer is provided with a predetermined count value to complete the call process.
However, the conventional AIN switching system employing the thread structure according to the UNIX system requires thread services in order to process a call. That is, UNIX uses thread services to execute a given process, and all the produced threads are provided with their own timer. Since each thread requires its own timer for allowing the operation at different times, a timer drive structure is provided to manage all the thread services. To this end, a table is provided to include a number of items corresponding to each respectively produced threads. Each timer item includes three fields for storing a thread ID (identification), timer ID, and timer count, respectively. The table is sequentially scanned every second so as to decrease the timer count for each timer item, one by one. Thus, when the time count becomes xe2x80x9c0xe2x80x9d, the thread is time-out, or that particular thread is removed.
For example, FIG. 1A schematically represents the initial timer table that includes a number of fields arranged in rows and columns for storing the thread ID 10, the timer ID 11, and the timer counter 12. In this case, as the table shows the initial state of the timer, all the items are initially in null state (NULL), and the pointer-to-insert the timer directs to the first thread field of the table. FIG. 1B illustrates the timer table when three timers are driven, and the pointer-to-insert the timer point is pointed to the fourth thread row. However, this timer drive structurexe2x80x94as shown in FIGS. 1A and 1Bxe2x80x94requires a large memory to accommodate all the timer items corresponding to the threads, as well as consuming too much time for sequentially scanning each thread item for detecting the time-out state.
FIG. 2A depicts a flow chart illustrating the method for adding a timer in a conventional timer drive structure. Initially, the thread items of the timer table are sequentially scanned in step 210 to search for the thread item in NULL state in step 212, and then a thread ID and timer count are inserted into their respective fields of the thread item in NULL state in step 214. Lastly, in step 216, the corresponding timer ID is allotted to the thread item. However, in this case, too much time is consumed for sequential scanning for each thread item in NULL state.
FIG. 2B depicts a flow chart illustrating the method for deleting the timer in the time-out state. First, the thread items of the timer table is sequentially scanned to decrease their respective timer counts by one every second in step 220. Upon detecting the thread ID having a zero count, the corresponding thread item is reported as being in the time-out state, in step 222. Thereafter, the respective fields of the time-out thread item are changed into NULL state in step 224, and the pointer is transferred to the next item in step 226. Again, too much time is consumed for scanning each item in the table in sequence to delete the timer with the time-out state. Thus, the thread structure of the conventional AIN switching system requires a large memory to accommodate the useless thread items waiting to be deleted in the table as well as increasing the processing time for sequentially searching for all the thread items as the number of thread items increases. There are additional problems such as directing the pointer to a new timer and treating the field from which the timer was deleted.
The operation of the conventional AIN switching system, which uses an individual process produced for each call to perform call processing, is explained herein. When a subscriber picks up the handset of a telephone, the hardware switching system detects the off-the-hook condition and produces an event message which is transferred to the switching message handler, which then transfers the event message to the call processing module to generate a UNIX process for the call request message. In this case, the half call concept is used to process the call in the interprocess communication (IPC) between two separate processes that are applied to the originating part and terminating part, respectively. However, according to such system, since the number of processes increases with the number of calls, each process occupying a portion of the CPU time to execute its routine according to the time scheduling of the UNIX system also increases. As the UNIX system must produce a process for each call and perform the context switching from one process to the next process, the speed of processing a call decreases rapidly with the number of calls. Thus, the speed of producing a process for a new call to establish an actual connection is delayed even further. Moreover, producing the process for the UNIX system call requires a relatively large portion of the system resource, such as memory region, stack region, CPU register, and other regions. Consequently, all these increased demands influence the amount of the data that is switched during the context switching between the processes so as to reduce the capacity of the AIN switching system. In order to resolve these problems involving a reduction of the processing capacity and speed, a conventional AIN switching system has been proposed which employs a thread call structure according to the UNIX system.
The thread call structure employing the thread call structure causes the process produced by the UNIX system to produce another thread to perform the call processing, instead of having the process directing the call processing. The process produces the corresponding thread to perform the call processing. Essentially, the thread becomes the user level entity produced by the process to allow a direct access through a given library, as compared to the process which is the kernel level entity produced by the UNIX system. Here, the library is usually called the thread library. As the process produces another thread/process and uses all the codes and data of the former through the thread library, the timer scheduler does not need the CPU time in relation with processing the code and the data. Hence, if a thread is switched to another thread after processing its codes and data, the amount of the data switched is considerably reduced as compared to the previously known structure. Thus, the thread call structure produces a thread to perform call processing using the thread library provided by the UNIX system, so that the time taken for producing the thread is much less than the time taken for producing the process by the UNIX system call.
Moreover, the portion of the system resource used to manage the thread is considerably less than that of the process, thus reducing the context switching between the threads, increasing the call processing speed as compared to the former process structure, and increasing the number of calls processed by the switching system. In summary, the thread call structure helps to resolve the problem associated with the number of calls which lowers the performance of the switching system, including the call processing speed due to the excessive use of the system resource and the requirement for having a large memory capacity.
Meanwhile, in the above stated conventional AIN switching system employing the thread call structure, each thread commonly occupies a single timer allotted to the corresponding process that produces them. In order for each thread to have a separate timer to perform its own operation at different times, there has been a proposed timer drive structure having a thread table, and having a number of timer items corresponding to each thread. However, such time driver structure still requires sequentially scanning each item in the table, thereby increases the searching time.
It is an object of the present invention to provide an AIN switching system with a thread call structure which is based on a timer item concept to obviate the unnecessary sequential scanning of the thread table.
It is another object of the present invention to provide a method for driving a thread timer in an AIN switching system with a thread call structure which allows a call to be quickly processed without requiring a large memory capacity.
It is still another object of the present invention to provide a method of providing, adding, and deleting timers for processing thread calls as needed, without fixing the number of the timers according to the number of the threads to be produced as in the conventional AIN switching system with a thread call structure.
The inventive concept is based on the double linked list data structure to drive a separate timer for each thread when processing calls in an AIN switching system with a thread call structure. This reduces the amount of the memory necessary for driving the timers as well as the time taken for searching them.
According to one aspect of the present invention, a method for providing an AIN (Advanced Intelligent Network) switching system employing a thread call structure with timers for each produced thread, the method comprises the steps of providing timer items respectively for each produced thread, wherein each of the timer items consisting of a thread ID region for storing the identifying data of the corresponding thread, a timer ID region for storing the identifying data of the corresponding timer, a time count region for storing the count data of corresponding timer, a rear pointer region for detecting the previous timer item, and a front pointer region for detecting the subsequent timer item, the count data being the time taken for driving the corresponding timer item; providing a head item for starting a timer drive process called per second, wherein the head item consisting of a head region for storing the head information and a front pointer region for indicating the timer item having the shortest count data; providing the timer items be arranged in the order of short to long count data with the head item being the first so as to form the double linked list structure; executing the timer drive process to sequentially reduce the count data of each timer item one by one until detecting the timer item whose count data equals to zero indicating the time-out state; informing the corresponding thread of the time-out and deleting the corresponding timer item; and, terminating the scanning of the timer list upon detecting the timer item whose front pointer is in null state.
The foregoing and other objects, features, and advantages of the invention will be apparent from the following more particular description of preferred embodiments as illustrated in the accompanying drawings in which reference characters refer to the same parts throughout the various views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention. dr
FIGS. 1A and 1B illustrate the timer drive table in a conventional AIN switching system employing the thread call structure according to the UNIX system;
FIGS. 2A and 2B are flow charts for illustrating the process of driving timers in a conventional AIN switching system employing the thread call structure according to the UNIX system;
FIG. 3 is a block diagram for illustrating the arrangement of the timers in accordance with the present invention employing the thread call structure according to the UNIX system;
FIG. 4 is a flow chart for illustrating the process of driving the timers in accordance with the present invention employing the thread call structure according to the UNIX system; and,
FIG. 5A is a block diagram for illustrating the adding of a timer to an inventive AIN switching system employing the thread call structure under the UNIX system; and,
FIG. 5B is a block diagram for illustrating the deletion of a timer in accordance with the present invention employing the thread call structure under the UNIX system.